using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using kxcxw.Data.Entities;

namespace kxcxw.Data.Mapping
{
	public class SysItemInfoMap : EntityTypeConfiguration<SysItemInfo>
	{
		public SysItemInfoMap()
		{
			// Primary Key
			this.HasKey(t => t.ItemID);

			// Properties
			this.Property(t => t.ItemID)
				.IsRequired()
				.HasMaxLength(36);
				
			this.Property(t => t.ItemName)
				.HasMaxLength(100);
				
			this.Property(t => t.itemDescription)
				.HasMaxLength(500);
				
			// Table & Column Mappings
			this.ToTable("SysItemInfo");
			this.Property(t => t.ItemID).HasColumnName("ItemID");
			this.Property(t => t.ItemName).HasColumnName("ItemName");
			this.Property(t => t.itemDescription).HasColumnName("itemDescription");
		}
	}
}

